//
//  PostVideoViewController.m
//  SIPphone
//
//  Created by wrt on 13-11-20.
//  Copyright (c) 2013年 wrtsoft. All rights reserved.
//

#import "PostVideoViewController.h"

@interface PostVideoViewController ()

@end

@implementation PostVideoViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

//带参数的初始化方法  将传递过来的内容存到相应的属性里
- (id)initWithNotice:(NSString *)notice andText:(NSString *)text andTime:(NSString *)time andURL:(NSString *)url
{
    self = [super init];
    if (self)
    {
        if ([notice isEqualToString:@"notice"])
        {
            self.tempNotice = [[NSString alloc] init];
            self.tempNotice = NSLocalizedString(@"notification message", @"通知消息 Notification message");
        }
        else
        {
            self.tempNotice = [[NSString alloc] init];
            self.tempNotice = NSLocalizedString(@"advertising message", @"广告消息 Advertising message");
        }
        self.tempText = [NSString stringWithFormat:@"      %@\n\n%@",text,time];
        self.tempURL = [[NSString alloc] init];
        self.tempURL = url;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    //设置对应的标题
    self.title = self.tempNotice;
    //设置文本窗口的内容
    self.textView.text = self.tempText;
    [self.webView setHidden:YES];
}

//播放按钮的操作
- (IBAction)beginOpen:(id)sender
{
    //将按钮隐藏 并将网址传到web控件里
    [self.beginButton setHidden:YES];
    [self.webView setHidden:NO];
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:self.tempURL]];
    [self.webView loadRequest:request];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
